import std.stdio;

class A 
{
    this(string name){_name = name;}
    int i = 0;
    string getName(){return _name;}
private:
    string _name;
}



void fun1(A a)
{
    writeln("fun1 : name = ", a.getName());
    a = new A("fun1 " ~ a.getName());
}

void fun2(ref A a)
{
        writeln("fun22222222222 : name = ", a.getName());
    
    a = new A("fun2 " ~ a.getName());
}


void ifun(ref int t )
{
    writeln("\n\n ifun ref t = ", t); // 50
    t = 10;
}

void ifun2(inout int t )
{
    writeln("\n\n ifun out t = ", t); // 0
   // t = 20;
}

void main()
{
   /* A a = new A("main A1");
    writeln("a.name : ", a.getName());
    fun1(a);
    writeln("after a.name : ", a.getName());
    
    writeln("\n\n");
    
    A a1 = new A("main A2");
    writeln("a1.name : ", a1.getName());
    fun2(a1);
    writeln("after a1.name : ", a1.getName()); */
    
    
    int a = 50;
    ifun(a);
    writeln("\n\n ifun ref t = ", a); // 10
    
    int b = 50;
    ifun2(b);
    writeln("\n\n ifun ref t = ", b); // 20
}
